<div class="container-save">
  <%unless session[:user].nil? -%>

           <% form_for :bookmark, :url => {:controller=>"advertisments", :action => "bookmark_ad" , :id => params[:id] } do |bookmark_form| %>
            <div class="save-ad-header">
                    <div class="save-ad-title">
                        Save Ad
                    </div>
                    <div class="save-ad-close" onclick="Dialog.okCallback();">
                       <%=image_tag "close.jpg" , :width=>"21px", :height=>"21px", :border=>"0px", :align=>"right", :alt=>"Close" ,:style=>"cursor:pointer;" -%>

                    </div>
            </div>
            <div class="save-ad-select-folder">
                  <%if @bookmarks %>
                    <div class="save-ad-radio-1">
                       <%= radio_button("bookmark", "createfolder", "no",:checked=>'checked',:onclick=>"$('folder').disabled=false;$('bookmark_folder').disabled=true") -%> Save to already created personal folder<br>
                      <div class="save-ad-drop-down">
                        Select Folder:
                            <select id="folder" name="bookmark[folder]">
                            <% @bookmarks.each do |bookmark|-%>
                            <option><%=bookmark.folder -%></option>
                            <%end -%>
                            </select>
                      </div>

                    </div>
                  <%end -%>
                   <div class="save-ad-radio-2">
                      <%= radio_button("bookmark", "createfolder", "yes",:onclick=>"$('bookmark_folder').disabled=false;$('folder').disabled=true") -%> Create new personal folder and save
                   </div>
                    <div class="create-new-folder">
                      <%if @bookmarks %>
                        <%= bookmark_form.text_field  :folder ,:disabled=> true,:size => 20,:class=>"create-new-folder",:maxlength=>"20", :value=>"Specify folder name" -%>
                      <%else%>
                        <%= bookmark_form.text_field  :folder ,:size => 20,:class=>"create-new-folder",:maxlength=>"20", :value=>"Specify folder name" -%>
                      <%end -%>
                   </div>
            </div>
                <div class="save-ad-buttons">
                <%= image_submit_tag("create save.jpg", :width=>"132px", :height=>"24px", :border=>"0px",  :alt=>"Save") -%>
                <%=image_tag "cancel.jpg" , :width=>"70px", :height=>"24px", :border=>"0px",  :alt=>"Cancel",:style=>"cursor:pointer;",:onclick=>"Dialog.okCallback();" -%>

                </div>
     <%end -%>
     <%else%>
                Please Login to Save this Advertisment
                <%=image_tag "cancel.jpg" , :width=>"70px", :height=>"24px", :border=>"0px",  :alt=>"Cancel",:style=>"cursor:pointer;",:onclick=>"Dialog.okCallback();" -%>
     <%end -%>
</div>
